#pragma once
#include"rbTree.h"

namespace my_code
{
	template<class K>
	class set
	{
		struct KofV
		{
			KofV()
			{}
			K operator()(const K& data)
			{
				return data;
			}
		};
	public:
		typedef rbTree_Iterator<K> iterator;

		iterator begin()
		{
			return _t.begin();
		}

		iterator end()
		{
			return _t.end();
		}

		bool Insert(K data)
		{
			return _t.Insert(data);
		}
	private:
		rbTree<K, K, KofV> _t;
	};

	void task()
	{
		int arr[10] = {8, 2, 4, 6, 3, 1, 0 };
		set<int> s;
		for (auto e : arr)
		{
			s.Insert(e);
		}

		for (auto e : s)
		{
			std::cout << e << " ";
		}
	}
}
